from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
from typing import Optional, Any
from module_admin.annotation.pydantic_annotation import as_query

class GameRecordModel(BaseModel):
    """
    账目记录表对应pydantic模型
    """

    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)

    id: Optional[int] = Field(default=None, description='ID')
    m_id: Optional[int] = Field(default=None, description='机器id')
    InCoin: Optional[str] = Field(alias='CurTimel', default=None, description='投币')
    OpenNum: Optional[str] = Field(alias='OpenNum', default=None, description='开分')
    InMoney: Optional[str] = Field(alias='InMoney', default=None, description='进钞')
    TotalInto: Optional[str] = Field(alias='TotalInto', default=None, description='总进')
    TotalOut: Optional[str] = Field(alias='TotalOut', default=None, description='总出')
    TotalPlayInto: Optional[str] = Field(alias='TotalPlayInto', default=None, description='总玩入')
    TotalPlayOut: Optional[str] = Field(alias='TotalPlayOut', default=None, description='总玩出')
    TotalPlayNum: Optional[str] = Field(alias='TotalPlayNum', default=None, description='总玩次数')
    TotalPlayWinNum: Optional[str] = Field(alias='TotalPlayWinNum', default=None, description='总赢次数')
    FreeGameCNum: Optional[str] = Field(alias='FreeGameCNum', default=None, description='免费游戏次数')
    WholeGameCNum: Optional[str] = Field(alias='WholeGameCNum', default=None, description='全盘游戏次数')
    SpecialRewardCNum: Optional[str] = Field(alias='SpecialRewardCNum', default=None, description='特殊奖励次数')
    OutCoin: Optional[str] = Field(alias='OutCoin', default=None, description='退币')
    ClearNum: Optional[str] = Field(alias='ClearNum', default=None, description='洗分')
    Lottery: Optional[str] = Field(alias='Lottery', default=None, description='彩票')
    TotalInOutBFB: Optional[str] = Field(alias='TotalInOutBFB', default=None, description='总进总出百分比')
    TotalPlayInOutBFB: Optional[str] = Field(alias='TotalPlayInOutBFB', default=None, description='总玩入 总玩出百分比')
    TotalPlayWinNumOrPlayNumBFB: Optional[str] = Field(alias='TotalPlayWinNumOrPlayNumBFB', default=None, description='总玩次数 与 总赢次数百分比')
    FreeGameFNum: Optional[str] = Field(alias='FreeGameFNum', default=None, description='免费游戏分数')
    WholeGameFNum: Optional[str] = Field(alias='WholeGameFNum', default=None, description='全盘游戏分数')
    SpecialRewardFNum: Optional[str] = Field(alias='SpecialRewardFNum', default=None, description='特殊奖励分数')
    create_time: Optional[int] = Field(default=None, description='创建时间')

class GameRecordQueryModel(GameRecordModel):
    """
    账目记录表不分页查询模型
    """

    begin_time: Optional[str] = Field(default=None, description='开始时间')
    end_time: Optional[str] = Field(default=None, description='结束时间')


@as_query
class GameRecordPageQueryModel(GameRecordQueryModel):
    """
    账目记录表分页查询模型
    """
    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=10, description='每页记录数')